package db

import "github.com/jinzhu/gorm"
import _ "github.com/go-sql-driver/mysql"

func MysqlConnection(host string, port string, user string, password string, dbname string) (db *gorm.DB, err error) {
	//db, err = gorm.Open("mysql", "user:password@/dbname?charset=utf8&parseTime=True&loc=Local")
	args := user + ":" + password + "@tcp(" + host + ":" + port + ")/" + dbname + "?charset=utf8&parseTime=True&loc=Local"
	db, err = gorm.Open("mysql", args)
	return db, err
}
